<template>
  <div class="min-h-screen bg-gray-50 p-5 max-w-6xl mx-auto">
    <div class="mb-8">
      <div class="bg-gradient-to-br from-indigo-500 to-purple-600 text-white rounded-xl p-6">
        <div class="flex items-center justify-between">
          <div class="flex items-center gap-2 text-xl font-semibold">
            <svg class="w-6 h-6" fill="currentColor" viewBox="0 0 20 20">
              <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm1-12a1 1 0 10-2 0v4a1 1 0 00.293.707l2.828 2.829a1 1 0 101.415-1.415L11 9.586V6z" clip-rule="evenodd"></path>
            </svg>
            历史记录
          </div>
          <button class="bg-white bg-opacity-20 hover:bg-opacity-30 px-3 py-1 rounded-lg text-sm font-medium transition-all duration-200 flex items-center gap-1">
            <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 20 20">
              <path fill-rule="evenodd" d="M4 2a1 1 0 011 1v2.101a7.002 7.002 0 0111.601 2.566 1 1 0 11-1.885.666A5.002 5.002 0 005.999 7H9a1 1 0 010 2H4a1 1 0 01-1-1V3a1 1 0 011-1zm.008 9.057a1 1 0 011.276.61A5.002 5.002 0 0014.001 13H11a1 1 0 110-2h5a1 1 0 011 1v5a1 1 0 11-2 0v-2.101a7.002 7.002 0 01-11.601-2.566 1 1 0 01.61-1.276z" clip-rule="evenodd"></path>
            </svg>
            刷新
          </button>
        </div>
        
        <div class="mt-5">
          <p class="text-sm opacity-90">查看您的操作历史和活动记录</p>
        </div>
      </div>
    </div>
    
    <div class="mt-5">
      <div class="bg-white rounded-lg shadow-sm">
        <div class="p-6 border-b border-gray-200">
          <div class="flex items-center gap-2 font-semibold text-gray-800">
            <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
              <path fill-rule="evenodd" d="M3 4a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm0 4a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm0 4a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z" clip-rule="evenodd"></path>
            </svg>
            操作记录
          </div>
        </div>
        
        <div class="p-5">
          <!-- 占位内容 -->
          <div class="space-y-0" v-if="placeholderItems.length > 0">
            <div class="flex items-center p-4 border-b border-gray-100 hover:bg-gray-50 transition-colors duration-200 last:border-b-0" v-for="item in placeholderItems" :key="item.id">
              <div class="flex items-center justify-center w-10 h-10 bg-gray-100 rounded-full mr-4">
                <svg class="w-5 h-5" :style="{color: item.color}" fill="currentColor" viewBox="0 0 20 20">
                  <path v-if="item.icon === 'login'" fill-rule="evenodd" d="M3 3a1 1 0 011 1v12a1 1 0 11-2 0V4a1 1 0 011-1zm7.707 3.293a1 1 0 010 1.414L9.414 9H17a1 1 0 110 2H9.414l1.293 1.293a1 1 0 01-1.414 1.414l-3-3a1 1 0 010-1.414l3-3a1 1 0 011.414 0z" clip-rule="evenodd"></path>
                  <path v-else-if="item.icon === 'account-circle'" fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-6-3a2 2 0 11-4 0 2 2 0 014 0zm-2 4a5 5 0 00-4.546 2.916A5.986 5.986 0 0010 16a5.986 5.986 0 004.546-2.084A5 5 0 0010 11z" clip-rule="evenodd"></path>
                  <path v-else-if="item.icon === 'lock'" fill-rule="evenodd" d="M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z" clip-rule="evenodd"></path>
                </svg>
              </div>
              <div class="flex-1">
                <div class="font-medium text-gray-900 mb-1">{{ item.title }}</div>
                <div class="text-xs text-gray-500">{{ item.time }}</div>
              </div>
              <div class="ml-4">
                <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium" :class="item.status === 'success' ? 'bg-green-100 text-green-800' : 'bg-yellow-100 text-yellow-800'">
                  {{ item.statusText }}
                </span>
              </div>
            </div>
          </div>
          
          <div class="flex flex-col items-center justify-center py-16 text-center" v-if="placeholderItems.length === 0">
            <svg class="w-12 h-12 text-gray-400 mb-4" fill="currentColor" viewBox="0 0 20 20">
              <path fill-rule="evenodd" d="M5 3a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2V5a2 2 0 00-2-2H5zm0 2h10v7h-2l-1-2H8l-1 2H5V5z" clip-rule="evenodd"></path>
            </svg>
            <p class="text-gray-500">暂无历史记录</p>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { ref } from 'vue'

export default {
  name: 'HistoryPage',
  setup() {
    // 占位数据
    const placeholderItems = ref([
      {
        id: 1,
        title: '登录系统',
        time: '2024-01-15 10:30:00',
        icon: 'login',
        color: '#4caf50',
        status: 'success',
        statusText: '成功'
      },
      {
        id: 2,
        title: '查看个人信息',
        time: '2024-01-15 10:25:00',
        icon: 'account-circle',
        color: '#2196f3',
        status: 'success',
        statusText: '成功'
      },
      {
        id: 3,
        title: '修改密码',
        time: '2024-01-15 09:45:00',
        icon: 'lock',
        color: '#ff9800',
        status: 'warning',
        statusText: '待确认'
      }
    ])
    
    return {
      placeholderItems
    }
  }
}
</script>

<style scoped>
/* Tailwind CSS样式已应用，无需额外CSS */
</style>